//
//  ZYHud.m
//  ZYOils
//
//  Created by WANGGNIT on 2019/9/30.
//  Copyright © 2019 WANGGNIT. All rights reserved.
//

#import "ZYHud.h"
#import "EasyLoadingView.h"
#import "EasyTextView.h"
#import "EasyShowView.h"


#define ZYLoadingBackColor  [[UIColor colorWithRed:234/255.0 green:233/255.0 blue:233/255.0 alpha:1] colorWithAlphaComponent:0.7]

#define ZYLoadingTextColor  [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1]

@implementation ZYHud


+(void)showLoadingText:(NSString *)text{
    
    [EasyLoadingView showLoadingText:text config:^EasyLoadingConfig *{
        return [EasyLoadingConfig shared].setBgColor(ZYLoadingBackColor).setTintColor(ZYLoadingTextColor).setLoadingType(LoadingShowTypeIndicator).setSuperReceiveEvent(NO);
    }];
}

+(void)showLoadingText:(NSString *)text withImageName:(NSString *)imageName{
    
    [EasyLoadingView showLoadingText:text imageName:imageName config:^EasyLoadingConfig *{
        return [EasyLoadingConfig shared].setLoadingType(LoadingShowTypeImageUpturnLeft).setBgColor(ZYLoadingBackColor).setTintColor(ZYLoadingTextColor).setSuperReceiveEvent(NO);
    }];
}

+(void)showSuccessText:(NSString *)text{
    
    [EasyTextView showSuccessText:text config:^EasyTextConfig *{
        return [EasyTextConfig shared].setShadowColor([UIColor whiteColor]).setBgColor(ZYLoadingBackColor).setTitleColor(ZYLoadingTextColor).setStatusType(TextStatusTypeMidden).setSuperReceiveEvent(NO);
    }];
}

+(void)showErrorText:(NSString *)text{
    
    [EasyTextView showErrorText:text config:^EasyTextConfig *{
        return [EasyTextConfig shared].setShadowColor([UIColor whiteColor]).setBgColor(ZYLoadingBackColor).setTitleColor(ZYLoadingTextColor).setStatusType(TextStatusTypeMidden).setSuperReceiveEvent(NO);
    }];
}

+(void)showTipsText:(NSString *)text{
    
    [EasyTextView showInfoText:text config:^EasyTextConfig *{
        return [EasyTextConfig shared].setShadowColor([UIColor whiteColor]).setBgColor(ZYLoadingBackColor).setTitleColor(ZYLoadingTextColor).setStatusType(TextStatusTypeMidden).setSuperReceiveEvent(NO);
    }];
}

+(void)showTipsText:(NSString *)text withImageName:(NSString *)imageName{
   
    [EasyTextView showImageText:text imageName:imageName config:^EasyTextConfig *{
        return [EasyTextConfig shared].setAnimationType(TextAnimationTypeNone).setShadowColor([UIColor clearColor]).setBgColor(ZYLoadingBackColor).setTitleColor(ZYLoadingTextColor).setSuperReceiveEvent(NO);
    }];
}

+(void)hideHud{
    [EasyLoadingView hidenLoading];
}

@end
